How Can I Compare Consecutive Values In An Array Without Using Their Indices